package com.cc.user.service.impl;

import com.cc.user.dao.UserDao;
import com.cc.user.entity.UserEntity;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.cc.user.dao.ScheduleDao;
import com.cc.user.entity.ScheduleEntity;
import com.cc.user.service.ScheduleService;


@Service("scheduleService")
public class ScheduleServiceImpl extends ServiceImpl<ScheduleDao, ScheduleEntity> implements ScheduleService {


    @Override
    public List<ScheduleEntity> getAllNotreadInfo(Long uid, int schedule_status) {
        ScheduleDao scheduleDao = this.baseMapper;
        return scheduleDao.selectList(new QueryWrapper<ScheduleEntity>().eq("uid",uid).eq("schedule_status", schedule_status));
    }

    @Override
    public int getNotreadInfoNum(Long uid) {
        ScheduleDao scheduleDao = this.baseMapper;
        return scheduleDao.getNotreadInfoNum(uid);
    }

    @Override
    public int deleteInfo(Long sid) {
        ScheduleDao scheduleDao = this.baseMapper;
        return scheduleDao.delete(new QueryWrapper<ScheduleEntity>().eq("sid",sid));
    }
}